#include <QMenuBar>
#include <QMenu>
#include <QToolBar>
#include <QAction>
#include <QApplication>
#include "CalcMainWindow.h"

CalcMainWindow::CalcMainWindow(QWidget *parent) :
    QMainWindow(parent)
{
    mCalcView = new CalcMainView(this);
    setCentralWidget(mCalcView);

    QMenu* optionsmenu = menuBar()->addMenu("Options");
    QAction* basicmode = new QAction("Basic mode",this);
    connect(basicmode,SIGNAL(triggered()),mCalcView,SLOT(handleBasicmode()));
    QAction* scientificmode = new QAction("Scientific mode",this);
    connect(scientificmode,SIGNAL(triggered()),mCalcView,SLOT(handleScientificmode()));
    QAction* programmode = new QAction("Program mode",this);
    connect(programmode,SIGNAL(triggered()),mCalcView,SLOT(handleProgrammode()));
    QAction* statisticsmode = new QAction("Statistics mode",this);
    connect(statisticsmode,SIGNAL(triggered()),mCalcView,SLOT(handleStatisticsmode()));
    // Add all actions to menu
    optionsmenu->addAction(basicmode);
    optionsmenu->addAction(scientificmode);
    optionsmenu->addAction(programmode);
    optionsmenu->addAction(statisticsmode);
}
